home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / ana.h next >
C/C++ Source or Header  |  1993-01-15  |  5KB  |  194 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15. #include <X11/Xlib.h>
  16. #include "net.h"
  17. #include "defs.h"
  18.  
  19.  
  20. #define max( a, b )        ( ( (a) > (b) ) ? (a) : (b) )
  21. #define min( a, b )        ( ( (a) < (b) ) ? (a) : (b) )
  22. #define    round( aa )        ( (int) ( (aa) + 0.5 ) )
  23.  
  24.  
  25. typedef unsigned long Pixel;
  26.  
  27.             /* color information */
  28. typedef struct
  29.   {
  30.     Pixel  black;
  31.     Pixel  white;
  32.     Pixel  traces;
  33.     Pixel  hilite;
  34.     Pixel  banner_bg;
  35.     Pixel  banner_fg;
  36.     Pixel  border;
  37.     Pixel  disj;
  38.     int    mono;
  39.     int    color_hilite;
  40.   } COL;
  41.  
  42.             /* pixmaps */
  43. typedef struct
  44.   {
  45.     Pixmap  gray;        /* full plane pixmap */
  46.     Pixmap  xpat;        /* full plane pixmap */
  47.     Pixmap  left_arrows;    /* full plane pixmap */
  48.     Pixmap  right_arrows;    /* full plane pixmap */
  49.     Pixmap  tops[3];        /* full plane pixmap */
  50.     Pixmap  bots[3];        /* full plane pixmap */
  51.     Pixmap  chk;        /* full plane pixmap */
  52.     Pixmap  icon;        /* bitmap */
  53.     Pixmap  iconbox;
  54.     Pixmap  sizebox;
  55.     Pixmap  select;        /* select hilight pattern */
  56.   } PIX;
  57.  
  58.             /* cursors */
  59. typedef struct
  60.   {
  61.     Cursor  deflt;
  62.     Cursor  left;
  63.     Cursor  right;
  64.     Cursor  timer;
  65.     Cursor  move;
  66.   } CURS;
  67.  
  68.  
  69. typedef struct
  70.   {
  71.     GC  black;        /* fg = black, bg = white */
  72.     GC  white;        /* fg = white, bg = black */
  73.     GC  inv;        /* invert gc, for menus */
  74.     GC  invert;        /* invert: for move, resize, highlight menu */
  75.     GC  gray;        /* for gray pattern */
  76.     GC  traceBg;    /* for traces window */
  77.     GC  traceFg;
  78.     GC  xpat;        /* fpr X pattern */
  79.     GC  hilite;        /* for hilighting */
  80.     GC  unhilite;
  81.     GC  curs_on;    /* turn cursor on/off */
  82.     GC  curs_off;
  83.     GC  bannerFg;    /* banner fg and bg */
  84.     GC  bannerBg;
  85.     GC  select;        /* select pattern */
  86.     GC  border;
  87.   } GCS;
  88.  
  89.  
  90. #ifndef NULL
  91. #define    NULL        0
  92. #endif
  93.  
  94. typedef    int    Coord;
  95. typedef    long    TimeType;
  96.  
  97.  
  98. typedef struct
  99.   {
  100.     int  selected;
  101.     int  iconified;
  102.     int  tooSmall;
  103.   } Wstate;
  104.  
  105.  
  106. typedef struct                /* Bounding box */
  107.   {
  108.     Coord    top, left;            /* top left corner */
  109.     Coord    bot, right;        /* bottom right corner */
  110.   } BBox;
  111.  
  112.  
  113. typedef struct
  114.   {
  115.     TimeType    first;
  116.     TimeType    last;
  117.     TimeType    start;
  118.     TimeType    steps;
  119.     TimeType    end;
  120.     TimeType    cursor;
  121.   } Times;
  122.  
  123.  
  124. typedef struct TraceEnt *Trptr;
  125.  
  126. typedef struct
  127.   {
  128.     int      total;        /* total number of traces */
  129.     int      disp;        /* number of traces displayed */
  130.     int      maxName;        /* longest name */
  131.     int      maxDigits;        /* longest string of digits */
  132.     Trptr    first;        /* ptr. to last trace displayed */
  133.     Trptr    last;        /* list of traces */
  134.   } Traces;
  135.  
  136.  
  137. typedef struct            /* Cache for history pointer */
  138.   {
  139.     hptr  wind;                /* window start */
  140.     hptr  cursor;            /* cursor value */
  141.   } Cache;
  142.  
  143. typedef struct TraceEnt
  144.   {
  145.     Trptr    next;        /* doubly linked list of traces */
  146.     Trptr    prev;
  147.     char     *name;        /* name stripped of path */
  148.     int      len;        /* length of name string */
  149.     Coord    top, bot;        /* position of the trace */
  150.     short    bdigit;        /* # of bits per digit for displaying */
  151.     short    vector;        /* 1 if bit vector, 0 if node */
  152.     union
  153.       {
  154.     nptr    nd;        /* what makes up this trace */
  155.     bptr    vec;
  156.       } n;
  157.     Cache    cache[1];
  158.   } TraceEnt;
  159.  
  160.  
  161. #define IsVector( to )        ( to->vector == TRUE and to->n.vec->nbits > 1 )
  162.  
  163.  
  164. typedef void (*Func)();
  165.  
  166.  
  167. typedef struct
  168.   {
  169.     char   *str;        /* item string */
  170.     Func   func;        /* function to call */
  171.     int    len;            /* length of str */
  172.     Coord  top, bot;        /* y position */
  173.   } MenuItem;
  174.  
  175.  
  176. typedef struct
  177.   {
  178.     char      *str;        /* header string */
  179.     MenuItem  *items;        /* items for this menu */
  180.     int       len;        /* length of header */
  181.     BBox      box;        /* bounding box of header */
  182.     Window    w;        /* window to pop-up */
  183.     Coord     width, height;    /* size of window */
  184.   } Menu;
  185.  
  186.  
  187. #define    MENU_MARK    '+'
  188. #define    MENU_UNMARK    '-'
  189.  
  190.  
  191.     /* get next history pointer, skiping punted events */
  192. #define    NEXTH( H, P )    for( (H) = (P)->next; (H)->punt; (H) = (H)->next )
  193.  
  194.